package com.rory.gooday.memorial;

import com.rory.gooday.common.model.Memorial;
import com.jfinal.plugin.activerecord.Page;

public class MemorialService {

	private final Memorial memorialDao = new Memorial().dao();

	public Page<Memorial> paginate(int pageNumber, int pageSize) {
		Page<Memorial> b = memorialDao.paginate(pageNumber, pageSize, "SELECT *", "FROM memorial order by important desc, id desc");
		return b;
	}
	
	public Memorial findById(int id) {
		return memorialDao.findById(id);
	}

	public void deleteById(int id) {
		memorialDao.deleteById(id);
	}
}
